//
//  BaseTableViewController.swift
//  Weibo
//
//  Created by 和丰行 on 16/8/3.
//  Copyright © 2016年 和丰行. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController, VisitorViewDelegate {
    
    // 定义一个变量保存用户当前是否登录
    var userLogin = UserAccount.userLogin()
    var VisitorView: visitorView?
    override func loadView() {
        
        userLogin ? super.loadView() : setUpVisitorView()
        
    }
    
    ///创建未登录界面
    private func setUpVisitorView(){
        VisitorView = visitorView()
        VisitorView?.delegate = self
        view = VisitorView
    }
    
    // MARK: - VisitorViewDelegate
    func visitorViewLogin() {
        // 1.弹出登录界面
        let oauthVC = OAuthUIViewController()
        let nav = UINavigationController(rootViewController: oauthVC)
        presentViewController(nav, animated: true, completion: nil)

    }
    
    func visitorViewRegister() {
        
    }


}
